﻿using Furion.DatabaseAccessor;
using System;
using System.ComponentModel.DataAnnotations;

namespace YFurion.Entities
{
    /// <summary>
    /// A shortcut of <see cref="YEntityOfTKey{TKey}"/> for most used primary key type (<see cref="long"/>).
    /// </summary>
    [Serializable]
    public abstract class YEntity : YEntityOfTKey<long>, IYEntity
    {
        [Key]
        public override long Id { get; set; }
    }

    /// <summary>
    /// A shortcut of <see cref="YEntityOfTKey{TKey}"/> for most used primary key type (<see cref="string"/>).
    /// </summary>
    /// <typeparam name="TDbContextLocator1"></typeparam>
    [Serializable]
    public abstract class YEntity<TDbContextLocator1> : YEntityOfTKey<long, TDbContextLocator1>, IYEntity<TDbContextLocator1>
        where TDbContextLocator1 : class, IDbContextLocator
    {
        [Key]
        public override long Id { get; set; } 
    }

    /// <summary>
    /// A shortcut of <see cref="YEntityOfTKey{TKey}"/> for most used primary key type (<see cref="string"/>).
    /// </summary>
    /// <typeparam name="TDbContextLocator1"></typeparam>
    /// <typeparam name="TDbContextLocator2"></typeparam>
    [Serializable]
    public abstract class YEntity<TDbContextLocator1, TDbContextLocator2> : YEntityOfTKey<long, TDbContextLocator1, TDbContextLocator2>, IYEntity<TDbContextLocator1, TDbContextLocator2>
        where TDbContextLocator1 : class, IDbContextLocator
        where TDbContextLocator2 : class, IDbContextLocator
    {
        [Key]
        public override long Id { get; set; }
    }

    /// <summary>
    /// A shortcut of <see cref="YEntityOfTKey{TKey}"/> for most used primary key type (<see cref="string"/>).
    /// </summary>
    /// <typeparam name="TDbContextLocator1"></typeparam>
    /// <typeparam name="TDbContextLocator2"></typeparam>
    /// <typeparam name="TDbContextLocator3"></typeparam>
    [Serializable]
    public abstract class YEntity<TDbContextLocator1, TDbContextLocator2, TDbContextLocator3> : YEntityOfTKey<long, TDbContextLocator1, TDbContextLocator2, TDbContextLocator3>, IYEntity<TDbContextLocator1, TDbContextLocator2, TDbContextLocator3>
        where TDbContextLocator1 : class, IDbContextLocator
        where TDbContextLocator2 : class, IDbContextLocator
        where TDbContextLocator3 : class, IDbContextLocator
    {
        [Key]
        public override long Id { get; set; } 
    }
}
